package com.itheima.mm.mapper;

import com.itheima.mm.pojo.QuestionTag;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description QuestionTagMapper
 * @Author xiao
 * @Date 2024-06-27
 */
@Mapper
public interface QuestionTagMapper {
    //通过问题id删除关联标签
    @Delete("delete from tr_question_tag where question_id = #{questionId}")
    void deleteByQuestionId(Integer questionId);

    //传入questionTag对象新增至数据库
    @Insert("insert into tr_question_tag values(#{questionId},#{tagId}) ")
    void add(QuestionTag questionTag);


}
